﻿"use strict";
var HALL_IP = "192.168.1.105";
var HALL_CLIENT_PORT = 7001;
var HALL_ROOM_PORT = 7002;
var GOLD_HALL_CLIENT_PORT = 7101;
var GOLD_HALL_ROOM_PORT = 7102;

var ACCOUNT_PRI_KEY = "^&*#$%()@";
var ROOM_PRI_KEY = "~!@#$(*&^%$&";

/** redis expire ttl **/
// default cache expire
exports.STR_KEY_EXPIRE = 10;
exports.HASH_KEY_EXPIRE = 100;

// user distace and position expire
exports.USER_DISTANCE_EXPIRE = 60;
exports.USER_POSITION_EXPIRE = 10000;


exports.mysql = function(){
	return {
		HOST:'192.168.1.105',
		USER:'root',
		PSWD:'123456',
		DB:'yp_zunyimj',
		PORT:3306,
	}
}


exports.redis = function() {
	return {
		URL : 'redis://192.168.1.105/0'
	};
};

//账号服配置
exports.account_server = function(){
	return {
		CLIENT_PORT:7000,
		HALL_IP:HALL_IP,
		HALL_CLIENT_PORT:HALL_CLIENT_PORT,
		GOLD_HALL_CLIENT_PORT: GOLD_HALL_CLIENT_PORT,
		ACCOUNT_PRI_KEY:ACCOUNT_PRI_KEY,
	};
};

//大厅服配置
exports.hall_server = function(){
	return {
		HALL_IP:HALL_IP,
		CLEINT_PORT:HALL_CLIENT_PORT,
		ROOM_PORT:HALL_ROOM_PORT,
		GOLD_CLIENT_PORT: GOLD_HALL_CLIENT_PORT,
		GOLD_ROOM_PORT: GOLD_HALL_ROOM_PORT,
		ACCOUNT_PRI_KEY:ACCOUNT_PRI_KEY,
		ROOM_PRI_KEY:ROOM_PRI_KEY
	};	
};

//游戏服配置
exports.game_server = function(){
	return {
		SERVER_ID:"001",
		
		//暴露给大厅服的HTTP端口号
		HTTP_PORT:7003,
		//HTTP TICK的间隔时间，用于向大厅服汇报情况
		HTTP_TICK_TIME:5000,
		//大厅服IP
		HALL_IP:HALL_IP,
		//大厅服端口
		HALL_PORT:HALL_ROOM_PORT,
		//与大厅服协商好的通信加密KEY
		ROOM_PRI_KEY:ROOM_PRI_KEY,
		
		//暴露给客户端的接口
		SOCKET_PORT:10000,
	};
};